package com.service.impl;

import com.dao.UserDao;

import com.entity.User;
import com.service.UserService;

public class UserServiceImpl implements UserService {
  private UserDao userDao= new UserDao();


    @Override
    public User register(User user) {
        User u = new User();
            u.setAccount(user.getAccount());


        return userDao.get(u) != null ? null : userDao.save(user);
    }

    @Override
    public User login(User user) {
        return userDao.get(user);
    }


}
